<template>
    <div style="height:100%; width:100%;background-color: white" class="detail">
        <bar class="bar" @on-back="$router.back()" title="帮助中心"></bar>
        <div class="youba-markdown" style="padding: 0px 10px;" v-html="mdstr" ></div>
    </div>
</template>

<script>
    import {
        Bar
    } from 'muka-ui'
    import marked from 'marked'
    import axios from 'axios'


    export default {
        name: 'noticeInfo',
        components: {
            Bar
        },
        data: function () {
            return {
                mdstr: 'asa'
            }
        },
        created: function () {
            let query = this.$route.query
            this.showMarked(query.index)
        },
        methods: {
            showMarked: function (index) {
                axios.get(
                    '/static/help/' + index + ".md", {
                        baseURL: '',

                    })
                    .then((response) => {
                        let a = marked(response.data, {
                            sanitize: true
                        })
                        this.mdstr = a
                    })
                    .catch(function (error) {
                        //异常
                    });
            }
        }
    }

</script>

<style lang="less">
    .youba-markdown
    {
        background-color: white;
        img{
        width: 100%;
    }
    }
</style>
